<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Reranker Framework (ReFr): reranker::FeatureVectorWriter&lt; FV &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Reranker Framework (ReFr)
   
   </div>
   <div id="projectbrief">Reranking framework for structure prediction and discriminative language modeling</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacereranker.html">reranker</a>      </li>
      <li class="navelem"><a class="el" href="classreranker_1_1_feature_vector_writer.html">FeatureVectorWriter</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">reranker::FeatureVectorWriter&lt; FV &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="reranker::FeatureVectorWriter" -->
<p>A class to serialize <a class="el" href="classreranker_1_1_feature_vector.html" title="A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type.">FeatureVector</a> instances to FeatureVecMessage instances.  
 <a href="classreranker_1_1_feature_vector_writer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="feature-vector-writer_8_h_source.html">feature-vector-writer.H</a>&gt;</code></p>

<p><a href="classreranker_1_1_feature_vector_writer-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector_writer.html#a10d99f419685418695e72c427971714e">SerializeFeature</a> (const typename FV::key_type &amp;uid, const typename FV::mapped_type &amp;value, FeatureMessage_FeatureType feature_type, FeatureMessage *feature_message, <a class="el" href="classreranker_1_1_symbols.html">Symbols</a> *symbols=NULL) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes a single feature-value pair to a <code>FeatureMessage</code>.  <a href="#a10d99f419685418695e72c427971714e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector_writer.html#aca8177e0f5f8c4ce8ee8d30238eec8d1">Write</a> (const FV &amp;features, FeatureMessage_FeatureType feature_type, FeatureVecMessage *fv_message, <a class="el" href="classreranker_1_1_symbols.html">Symbols</a> *symbols=NULL) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes the specified feature vector to the specified <code>FeatureVecMessage</code> protocol buffer message.  <a href="#aca8177e0f5f8c4ce8ee8d30238eec8d1"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename FV&gt;<br/>
class reranker::FeatureVectorWriter&lt; FV &gt;</h3>

<p>A class to serialize <a class="el" href="classreranker_1_1_feature_vector.html" title="A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type.">FeatureVector</a> instances to FeatureVecMessage instances. </p>
<dl class=""><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">the</td><td>type of <a class="el" href="classreranker_1_1_feature_vector.html" title="A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type.">FeatureVector</a> to write </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector-writer_8_h_source.html#l00060">60</a> of file <a class="el" href="feature-vector-writer_8_h_source.html">feature-vector-writer.H</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a10d99f419685418695e72c427971714e"></a><!-- doxytag: member="reranker::FeatureVectorWriter::SerializeFeature" ref="a10d99f419685418695e72c427971714e" args="(const typename FV::key_type &amp;uid, const typename FV::mapped_type &amp;value, FeatureMessage_FeatureType feature_type, FeatureMessage *feature_message, Symbols *symbols=NULL) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FV&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_feature_vector_writer.html">reranker::FeatureVectorWriter</a>&lt; FV &gt;::<a class="el" href="classreranker_1_1_feature_vector_writer.html#a10d99f419685418695e72c427971714e">SerializeFeature</a> </td>
          <td>(</td>
          <td class="paramtype">const typename FV::key_type &amp;&#160;</td>
          <td class="paramname"><em>uid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const typename FV::mapped_type &amp;&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FeatureMessage_FeatureType&#160;</td>
          <td class="paramname"><em>feature_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FeatureMessage *&#160;</td>
          <td class="paramname"><em>feature_message</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_symbols.html">Symbols</a> *&#160;</td>
          <td class="paramname"><em>symbols</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Serializes a single feature-value pair to a <code>FeatureMessage</code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">uid</td><td>the uid of this feature-value pair </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>the value of this feature-value pair </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">feature_type</td><td>the type of features contained in the specified feature vector to be serialized (specified in model.proto) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">feature_message</td><td>the <code>FeatureMessage</code> instance to fill in </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">symbols</td><td>a pointer to an optional <a class="el" href="classreranker_1_1_symbols.html" title="An interface specifying a converter from symbols (strings) to int indices.">Symbols</a> instance to be used when determining the symbol of a feature&rsquo;s uid </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector-writer_8_h_source.html#l00075">75</a> of file <a class="el" href="feature-vector-writer_8_h_source.html">feature-vector-writer.H</a>.</p>

</div>
</div>
<a class="anchor" id="aca8177e0f5f8c4ce8ee8d30238eec8d1"></a><!-- doxytag: member="reranker::FeatureVectorWriter::Write" ref="aca8177e0f5f8c4ce8ee8d30238eec8d1" args="(const FV &amp;features, FeatureMessage_FeatureType feature_type, FeatureVecMessage *fv_message, Symbols *symbols=NULL) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename FV&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_feature_vector_writer.html">reranker::FeatureVectorWriter</a>&lt; FV &gt;::<a class="el" href="classreranker_1_1_feature_vector_writer.html#aca8177e0f5f8c4ce8ee8d30238eec8d1">Write</a> </td>
          <td>(</td>
          <td class="paramtype">const FV &amp;&#160;</td>
          <td class="paramname"><em>features</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FeatureMessage_FeatureType&#160;</td>
          <td class="paramname"><em>feature_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FeatureVecMessage *&#160;</td>
          <td class="paramname"><em>fv_message</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_symbols.html">Symbols</a> *&#160;</td>
          <td class="paramname"><em>symbols</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Serializes the specified feature vector to the specified <code>FeatureVecMessage</code> protocol buffer message. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">features</td><td>the feature vector to serialize </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">feature_type</td><td>the type of features contained in the specified feature vector to be serialized (specified in model.proto) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">fv_message</td><td>the FeatureVecMessage instance to fill in with the serialized version of the specified feature vector </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">symbols</td><td>a pointer to an optional <a class="el" href="classreranker_1_1_symbols.html" title="An interface specifying a converter from symbols (strings) to int indices.">Symbols</a> instance to be used when determining the symbol of a feature&rsquo;s uid </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector-writer_8_h_source.html#l00104">104</a> of file <a class="el" href="feature-vector-writer_8_h_source.html">feature-vector-writer.H</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="feature-vector-writer_8_h_source.html">feature-vector-writer.H</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Apr 9 2013 11:56:30 for Reranker Framework (ReFr) by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
